/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.librarycard.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import cn.edu.pku.wxlib.librarycard.model.*;
import cn.edu.pku.wxlib.librarycard.service.*;
import cn.edu.pku.wxlib.librarycard.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


public class Librarycard extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Librarycard";
	public static final String ALIAS_LIBRARY_CARD_ID = "libraryCardId";
	public static final String ALIAS_USER_ID = "userId";
	public static final String ALIAS_LIBRARY_CARD_NUMBER = "libraryCardNumber";
	public static final String ALIAS_CREATE_TIME = "createTime";
	public static final String ALIAS_STATE = "1启用，0禁用";
	
	//date formats
	public static final String FORMAT_CREATE_TIME = DATE_FORMAT;
	
	//columns START
    /** libraryCardId       db_column: libraryCardId */	
	
	private java.lang.Integer libraryCardId;
    /** userId       db_column: userId */	
	
	private java.lang.Integer userId;
    /** libraryCardNumber       db_column: libraryCardNumber */	
	@Length(max=7)
	private java.lang.String libraryCardNumber;
    /** createTime       db_column: createTime */	
	
	private java.util.Date createTime;
    /** 1启用，0禁用       db_column: state */	
	
	private java.lang.Integer state;
	//columns END

	public Librarycard(){
	}

	public Librarycard(
		java.lang.Integer libraryCardId
	){
		this.libraryCardId = libraryCardId;
	}

	public void setLibraryCardId(java.lang.Integer value) {
		this.libraryCardId = value;
	}
	
	public java.lang.Integer getLibraryCardId() {
		return this.libraryCardId;
	}
	public void setUserId(java.lang.Integer value) {
		this.userId = value;
	}
	
	public java.lang.Integer getUserId() {
		return this.userId;
	}
	public void setLibraryCardNumber(java.lang.String value) {
		this.libraryCardNumber = value;
	}
	
	public java.lang.String getLibraryCardNumber() {
		return this.libraryCardNumber;
	}
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
		setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	public void setState(java.lang.Integer value) {
		this.state = value;
	}
	
	public java.lang.Integer getState() {
		return this.state;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("LibraryCardId",getLibraryCardId())
			.append("UserId",getUserId())
			.append("LibraryCardNumber",getLibraryCardNumber())
			.append("CreateTime",getCreateTime())
			.append("State",getState())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getLibraryCardId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Librarycard == false) return false;
		if(this == obj) return true;
		Librarycard other = (Librarycard)obj;
		return new EqualsBuilder()
			.append(getLibraryCardId(),other.getLibraryCardId())
			.isEquals();
	}
}

